
capture drop program dir_clear

program define dir_clear, nclass
	
	syntax [anything], dir(string) ext(string)

	// get current directory
	local dir_current `c(pwd)'
	
	cd `dir'
	local files: dir . files "*.`ext'", respectcase
	foreach str of local files {
		erase "`str'"
	}
	
	cd `dir_current'

	
end
	
